package com.bxj.wxtt.service.impl;

import com.bxj.wxtt.api.domain.Adv;
import com.bxj.wxtt.mapper.master.AdvMasterMapper;
import com.bxj.wxtt.mapper.slave.AdvSlaveMapper;
import com.bxj.wxtt.service.AdvService;
import com.ifeng.matrix.common.domain.PageResult;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * 由MyBatis Generator工具自动生成 2018-07-18 19:49:05
 */
@Component("advService")
public class AdvServiceImpl implements AdvService {
    @Resource
    AdvMasterMapper advMasterMapper;

    @Resource
    AdvSlaveMapper advSlaveMapper;

    public List<Adv> getAdvList(Adv adv) {
        return advSlaveMapper.getAdvList(adv);
    }

    public Adv selectById(String id) {
        return advSlaveMapper.selectById(id);
    }

    public PageResult<Adv> getAdvPage(Adv adv) {
        PageResult pageResult = new PageResult();
        pageResult.setCount(advSlaveMapper.countSeletive(adv));
        pageResult.setResult(advSlaveMapper.getAdvList(adv));
        return pageResult;
    }

    public int insert(Adv adv) {
        return advMasterMapper.insert(adv);
    }

    public int deleteAdvById(String id) {
        return advMasterMapper.deleteAdvById(id);
    }

    public int updateAdvById(Adv adv) {
        return advMasterMapper.updateAdvById(adv);
    }
}